package com.meixiang.fragment.moneyManagement;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.meixiang.R;
import com.meixiang.activity.account.myMoneyManagement.MoneyManagementDetailActivity;
import com.meixiang.activity.moments.PostDetailsActivity;
import com.meixiang.adapter.personalCenter.MoneyManagementAdapter;
import com.meixiang.main.BaseFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * @author yinsujun  Created at 2016/5/6 14:06
 *         回款中
 */
public class ReturnedMoneyFragment extends BaseFragment {
    @Bind(R.id.money_management_recycler)
    RecyclerView mRecycler;
    private MoneyManagementAdapter mAdapter;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_money_management, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    protected void initTitle() {

    }

    @Override
    protected void initView() {
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mRecycler.setLayoutManager(linearLayoutManager);
        mAdapter=new MoneyManagementAdapter(getActivity());
        mRecycler.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener(new MoneyManagementAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
//                Intent intent=new Intent(getActivity(),PostDetailsActivity.class);
                Intent intent=new Intent(getActivity(),MoneyManagementDetailActivity.class);
                intent.putExtra("type","1");
                startActivity(intent);
            }
        });
    }

    @Override
    protected void setData() {

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
